﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace MMS.UI.Areas.Admin.ViewModels
{
    public class SalesPromotionModel
    {
        public int SId { get; set; }
        [DisplayName("促销消费最低金额"), Required(ErrorMessage = "促销消费最低金额不能为空")]
        /// <summary>
        /// 促销消费最低金额
        /// </summary>
        public decimal? SMinMoney { get; set; }

        [DisplayName("促销消费最高金额"), Required(ErrorMessage = "促销消费最高金额不能为空")]
        /// <summary>
        ///促销消费最高金额
        /// </summary>
        public decimal? SMaxMoney { get; set; }

        [DisplayName("积分"), Required(ErrorMessage = "积分不能为空")]
        /// <summary>
        /// 积分
        /// </summary>
        public int? SIntegral { get; set; }

        [DisplayName("促销开始时间")]
        /// <summary>
        /// 促销开始时间
        /// </summary>
        public DateTime? SBeginTime { get; set; }

        [DisplayName("促销结束时间")]
        /// <summary>
        /// 促销结束时间
        /// </summary>
        public DateTime? SEndTime { get; set; }
        [DisplayName("促销地点")]
        /// <summary>
        /// 促销地点
        /// </summary>
        public string SPlace { get; set; }
       

        [DisplayName("备注说明")]
        /// <summary>
        /// 备注说明
        /// </summary>
        public string SRemark { get; set; }

        public MMS.Model.SalesPromotion ToModel()
        {
            return new MMS.Model.SalesPromotion()
            {
                SId = this.SId,
                SMinMoney = this.SMinMoney,
                SMaxMoney = this.SMaxMoney,
                SIntegral = this.SIntegral,
                SBeginTime = this.SBeginTime,
                SEndTime = this.SEndTime,
                SPlace = this.SPlace,
                SRemark = this.SRemark,

            };
        }
    }
}